﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_Product class is a concrete class that represents a collection of physical elements, software features and, other products, acquired as a unit. Acquisition implies an agreement between the supplier and consumer, which can have implications on product licensing, support, and warranty.
    /// </summary>
    public class CIM_Product
    {

        private string _Caption;
        private string _Description;
        private string _IdentifyingNumber;
        private string _Name;
        private string _SKUNumber;
        private string _Vendor;
        private string _Version;

        /// <summary>
        /// Short textual description for the product.
        /// </summary>
        public string Caption { get { return _Caption; } }

        /// <summary>
        /// Textual description of the product.
        /// </summary>
        public string Description { get { return _Description; } }

        /// <summary>
        /// Product identification, such as a serial number on software, a die number on a hardware chip, or (for noncommercial products) a project number.
        /// </summary>
        public string IdentifyingNumber { get { return _IdentifyingNumber; } }

        /// <summary>
        /// Commonly used product name.
        /// </summary>
        public string Name { get { return _Name; } }

        /// <summary>
        /// Product's stock-keeping unit (SKU) information.
        /// </summary>
        public string SKUNumber { get { return _SKUNumber; } }

        /// <summary>
        /// Name of the product's supplier, or the entity selling the product (the manufacturer, reseller, OEM, and so on).
        /// </summary>
        public string Vendor { get { return _Vendor; } }

        /// <summary>
        /// Product version information.
        /// </summary>
        public string Version { get { return _Version; } }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_Product(ManagementBaseObject mbo)
        {
            _Caption = mbo.GetStringValue("Caption");
            _Description = mbo.GetStringValue("Description");
            _IdentifyingNumber = mbo.GetStringValue("IdentifyingNumber");
            _Name = mbo.GetStringValue("Name");
            _SKUNumber = mbo.GetStringValue("SKUNumber");
            _Vendor = mbo.GetStringValue("Vendor");
            _Version = mbo.GetStringValue("Version");
        }

    }
}
